Index: libgadu-1.9.0/configure.ac
===================================================================
--- libgadu-1.9.0.orig/configure.ac
+++ libgadu-1.9.0/configure.ac
@@ -159,7 +159,7 @@ if test "x$with_pthread" != "xno"; then
 	[
 		dnl workaround dla pkgconfiga
 		if test "x$PTHREAD_CFLAGS" = "x-pthread"; then
-			PTHREAD_LIBS="$PTHREAD_LIBS -pthread"
+			PTHREAD_LIBS="$PTHREAD_LIBS -lpthread"
 		fi
 
 		LIBS="$PTHREAD_LIBS $LIBS"
Index: libgadu-1.9.0/m4/acx_pthread.m4
===================================================================
--- libgadu-1.9.0.orig/m4/acx_pthread.m4
+++ libgadu-1.9.0/m4/acx_pthread.m4
@@ -44,7 +44,7 @@ fi
 # C compiler flags, and other items are library names, except for "none"
 # which indicates that we try without any flags at all.
 
-acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt"
+acx_pthread_flags="-lpthread pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt"
 
 # The ordering *is* (sometimes) important.  Some notes on the
 # individual items follow:
